/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙，邂逅框架梦]
 * 
 * https://zhiqim.org/project/zhiqim_framework/zhiqim_kernel.htm
 *
 * Zhiqim Kernel is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
package org.zhiqim.kernel.constants;

import java.nio.charset.Charset;

import org.zhiqim.kernel.annotation.AnAlias;

/**
 * 编码常量定义，包括字符集编码、签名、编解码等
 *
 * @version v1.0.0 @author zouzhigang 2014-2-27 新建与整理
 */
@AnAlias("CodeConstants")
public interface CodeConstants extends SignConstants
{
    String _UTF_8_                  = "UTF-8";//BOM EF BB BF
    Charset _UTF_8_C_               = Charset.forName(_UTF_8_);
    
    String _GBK_                    = "GBK";
    Charset _GBK_C_                 = Charset.forName(_GBK_);
    
    //Unicode下的编码
    String _UTF_16_                 = "UTF-16";//无指BOM由字节自行检查
    String _UTF_16LE_               = "UTF-16LE";//BOM FF FE
    String _UTF_16BE_               = "UTF-16BE";//BOM FE FF
    String _UTF_32_                 = "UTF-32";//无指定BOM由字节自行检查
    String _UTF_32LE_               = "UTF-32LE";//BOM FF FE 00 00
    String _UTF_32BE_               = "UTF-32BE";//BOM 00 00 FE FF
    
    Charset _UTF_16BE_C_            = Charset.forName(_UTF_16BE_);
    
    //ANSI下的本地语言
    String _ISO_8859_1_             = "ISO-8859-1";
    String _GB2312_                 = "GB2312";
    
    //编解码
    String _HEX_                    = "HEX";
    String _BASE64_                 = "Base64";
    String _MD5_                    = "MD5";
    String _SHA1_                   = "SHA1";
    String _SHA256_                 = "SHA-256";
    String _RSA_                    = "RSA";
    String _DES_                    = "DES";
    String _AES_                    = "AES";
    
    String _CBC_                    = "CBC";
    String _ECB_                    = "ECB";
    String _PKCS5_PADDING_          = "PKCS5Padding";
    String _PKCS7_PADDING_          = "PKCS7Padding";
    String _DES_ECB_ZEROPADDING_    = "DES/ECB/NoPadding";
    
    String _HMAC_MD5_               = "HmacMD5";
    String _HMAC_SHA1_              = "HmacSHA1";  
    String _HMAC_SHA256_            = "HmacSHA256";  
    String _HMAC_SHA384_            = "HmacSHA384";
    String _HMAC_SHA512_            = "HmacSHA512";
    
    String _X_509_                  = "X.509";
    
    //BASE64标准64个字符，和支持的填充字符（等号和回车换行）
    String _BASE64_STD_             = _LETTERS_DIGITS_ + "+/";
    String _BASE64_EXT_             = _LETTERS_DIGITS_ + "+/=\r\n";
    byte[] _BASE64_BS_              = _BASE64_STD_.getBytes();//64个BASE64字符
    byte   _BASE64_PAD_             = (byte)'=';//不足8的倍数填充符
}
